package com.yh.patterns.state.job;

/**
 * @Author:云尚
 * @Description:环境类
 */
public class Player {
    private String name;
    private State state;
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public Player(String name) {
        this.name = name;
        this.state=new PrimaryState(this);
    }

    public void play_win(){
        state.play_win();
    }
    public void play_lose(){
        state.play_lose();
    }
    public void doubleScore(){
        state.doubleScore();
    }
    public void changeCards(){
        state.changeCards();
    }
    public void peekCards(){
        state.peekCards();
    }
}
